//
//  ChooseAndCheckView.swift
//  ANOA
//
//  Created by 邱仙凯 on 2024/12/16.
//  Copyright © 2024 zwb. All rights reserved.
//

import UIKit
 
class ChooseAndCheckView:UIView {
    
    var checkInvoiceClosure:((UIButton)->())?
    var btn1:UIButton!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = UIColor(kshex: "f2f2f2")
        
         btn1 = AllSelectBtn(frame: CGRect(x:15,y:0,width: 90,height: self.frame.height))
        btn1.tag = 1
        btn1.addTarget(self, action: #selector(btnAction(sender:)), for: .touchUpInside)
        btn1.setTitle("全选", for: .normal)
        btn1.setTitleColor(.black, for: .normal)
        btn1.setImage(UIImage(named:"selectButton"), for: .normal)
         btn1.setImage(UIImage(named:"selectedButton"), for: .selected)
        
        let btn2 = UIButton(frame: CGRect(x:self.frame.width - 120 - 15,y:(self.frame.height - 40)/2,width: 122,height: 38))
        btn2.tag = 2
        btn2.titleLabel?.font = UIFont.systemFont(ofSize: 15)
        btn2.setTitleColor(Theme.primaryColor(), for: .normal)
         btn2.addTarget(self, action: #selector(btnAction(sender:)), for: .touchUpInside)
        btn2.setTitle("开始查验", for: .normal)
        btn2.layer.cornerRadius = 20
        btn2.layer.borderWidth = 1
        btn2.layer.borderColor = Theme.primaryColor().cgColor
        btn2.backgroundColor = UIColor(kshex: "#CCE5FF")
        self.addSubview(btn1)
        self.addSubview(btn2)
        
        
    }
  
    @objc func btnAction(sender:UIButton){
        if let clo = checkInvoiceClosure {
            clo(sender)
        }
    }
    
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
